<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>main page</title>
    <script type="text/javascript">
        var jsonObj = {
            "key1" : 1,
            "key2" : "2",
            "key3" : {
                "key3_1" : "3_1",
                "key3_2" : 32
            },
            "key4" : [{
                "key4_1_1": "411",
                "key4_1_2": "412",
            },{
                "key4_2_1": "421",
                "key4_2_2": "422",
            }]
        };
        alert(jsonObj.key1);
        alert(jsonObj.key2);
        alert(jsonObj.key3.key3_1);
        alert(jsonObj.key3.key3_2);
        alert(jsonObj.key4[0].key4_1_1);
        alert(jsonObj.key4[0].key4_1_2);
        alert(jsonObj.key4[1].key4_2_1);
        alert(jsonObj.key4[1].key4_2_2);
        var jsonObjString = JSON.stringify(jsonObj);
        alert(jsonObjString)

        var jsonObj2 = JSON.parse(jsonObjString);
        alert(jsonObj2.key1)
        alert(jsonObj2.key2)

    </script>
</head>
<body>

</body>
</html>